﻿<Window x:Class="ConcatPdf.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:wpfToolKit="http://schemas.xceed.com/wpf/xaml/toolkit"
        xmlns:local="clr-namespace:ConcatPdf"
        mc:Ignorable="d"
        d:DataContext="{d:DesignInstance Type=local:ViewModel}"
        Title="Объединение Pdf-файлов"
        WindowStartupLocation="CenterScreen"
        SizeToContent="WidthAndHeight">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="30"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <TextBlock Text="Количество файлов:" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Margin="5"/>
        <wpfToolKit:IntegerUpDown Grid.Row="0" Grid.Column="1" Height="20" Margin="5" Minimum="2"
                                  Increment="1" Maximum="10"
                                  Value="{Binding KolFiles, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

        <Label Grid.Row="1" Grid.Column="0" Content="Файлы PDF"  Margin="5"/>
        <DataGrid Grid.Row="1" Grid.Column="1" AutoGenerateColumns="False"  Margin="5"
                          CanUserDeleteRows="False" 
                          HorizontalAlignment="Center" VerticalAlignment="Top"
                          ItemsSource="{Binding RowTableFilesCollection}">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Имя файла"
                                            Binding="{Binding NameFile, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" 
                                            IsReadOnly="True"/>
                <DataGridTemplateColumn Header="Открыть" >
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button Margin="5" d:DataContext="{d:DesignInstance Type=local:RowTableFiles}"
                                            Content="{Binding ButtonLabelFilePl}" 
                                            Command="{Binding BaseCommandButton}"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTextColumn Header="Данные загружены?" IsReadOnly="True" 
                                            Binding="{Binding IsLoadStr, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
            </DataGrid.Columns>
        </DataGrid>

        <Button Grid.Row="2" Grid.Column="1" Content="Объединить" Height="30" Margin="5" Command="{Binding BaseCommandConcat}"/>
    </Grid>

</Window>
